x86+libxl: correct p2m (shadow) memory pool size calculation
authorJan Beulich <jbeulich@suse.com>
Thu, 28 Apr 2022 08:00:49 +0000 (10:00 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 28 Apr 2022 08:00:49 +0000 (10:00 +0200)
commit2c992810854a15b41be920519ce83a4a328d5168
treeeee8f04a490068f28f24b85411fa73cdafb40526
parent9c432b876bf518866d431bda73f2be1250f688eb
x86+libxl: correct p2m (shadow) memory pool size calculation

The reference "to shadow the resident processes" is applicable to
domains (potentially) running in shadow mode only. Adjust the
calculations accordingly. This, however, requires further parameters.
Since the original function is deprecated anyway, and since it can't be
changed (for being part of a stable ABI), introduce a new (internal
only) function, with the deprecated one simply becoming a wrapper.

In dom0_paging_pages() also take the opportunity and stop open-coding
DIV_ROUND_UP().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
tools/libs/light/libxl_create.c
tools/libs/light/libxl_internal.h
tools/libs/light/libxl_utils.c
xen/arch/x86/dom0_build.c